/*
 * jlb
 */
package com.jlb.active.dao;

import com.jlb.active.entity.ActivePool;
import com.jlb.active.entity.ActivePoolState;
import com.jlb.core.base.BaseDAO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 激活币池
 *
 * @author jlb
 */
@Mapper
@Repository
public interface ActivePoolDAO extends BaseDAO<ActivePool, Long> {

    /**
     * 加载一个对象ActivePool通过id
     *
     * @param id
     * @return User
     */
    ActivePool loadById(@Param("id") java.lang.Long id);

    /**
     * 根据主键id,oldStates 共同更新 ActivePool 的状态到newState状态
     *
     * @param id
     * @param newState  新状态
     * @param oldStates 旧状态集合
     */
    void updateStateById(@Param("id") java.lang.Long id, @Param("updateTime") Date updateTime, @Param("newState") ActivePoolState newState, @Param("oldStates") ActivePoolState... oldStates);

    /**
     * 根据主键id 更新 ActivePool 的状态到另一个状态
     *
     * @param id
     * @param state 状态
     */
    void updateById(@Param("id") java.lang.Long id, @Param("state") ActivePoolState state, @Param("updateTime") Date updateTime);

    /**
     * 删除对象ActivePool
     *
     * @param params 实体的属性
     */
    void delete(Map<String, Object> params);


    /**
     * 查询ActivePool列表
     *
     * @param rowBounds 分页参数
     * @return List<ActivePool>
     */
    List<ActivePool> list(RowBounds rowBounds);


    /**
     * 查询ActivePool分页 根据状态
     *
     * @param id
     * @return List<ActivePool>
     */
    List<ActivePool> listByPk(java.lang.Long id, ActivePoolState state, RowBounds rowBounds);

    int countByPk(java.lang.Long id, ActivePoolState state);

    /**
     * 加载一个对象ActivePool通过id
     *
     * @param code
     * @return ActivePool
     */
    ActivePool loadByCode(@Param("code") java.lang.String code);
}
